import request from '@/utils/request'

/**
 *
 * @param {菜单管理列表} params
 */
export function getMenu (params) {
  return request({
    url: '/systemanage/systemMenu/getTree',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

/**
 *
 * @param {菜单查看} params
 */
export function menuDetails (params) {
  return request({
    url: '/systemanage/systemMenu/menuDetails',
    method: 'post',
    params
  })
}
/**
 *
 * @param {菜单表单提交} params
 */
export function addOrUpdateMenu (params) {
  return request({
    url: '/systemanage/systemMenu/addOrUpdateMenu',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
/**
 *
 * @param {菜单表单删除} params
 */
export function deleteMenu (params) {
  return request({
    url: '/systemanage/systemMenu/deleteMenu',
    method: 'post',
    params
  })
}
/**
 *
 * @param {菜单列表回显} params
 */
export function getTreeByRole (params) {
  return request({
    url: 'systemanage/systemMenu/getTreeByRole',
    method: 'post',
    params
  })
}

/**
 *
 * @param {查询机构列表} params
 */
export function getOrgData (params) {
  return request({
    url: 'system/department/selectDepartmentTree',
    method: 'post',
    params
  })
}
/**
 *
 * @param {查询工艺列表} params
 */
export function getDeviceData (params) {
  return request({
    url: 'system/listDeviceTree',
    method: 'post',
    params
  })
}
/**
 *
 * @param {获取所属公司列表} params
 */
export function getOrgList (params) {
  return request({
    url: 'system/org/listId',
    method: 'post',
    data: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
/**
 *
 * @param {根据id查询父级} params
 */
export function selectDepartmentById (params) {
  return request({
    url: 'system/department/selectDepartmentById',
    method: 'post',
    params
  })
}
/**
 *
 * @param {机构管理-添加} params
 */
export function addOrg (params) {
  return request({
    url: 'system/department/addDepartment',
    method: 'post',
    params
  })
}
/**
 *
 * @param {机构管理-编辑} params
 */
export function editOrg (params) {
  return request({
    url: 'system/department/editDepartment',
    method: 'post',
    params
  })
}
/**
 *
 * @param {机构管理-删除提示} params
 */
export function delTipInfo (params) {
  return request({
    url: 'system/department/checkDelDepartment',
    method: 'post',
    params
  })
}
/**
 *
 * @param {机构管理-删除} params
 */
export function deleteOrg (params) {
  return request({
    url: 'system/department/delDepartment',
    method: 'post',
    params
  })
}
